home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2002 January / january_2002.iso / Piposh Special / Piposh / FRITZ1.DXR / 00134_chkhit & bchkhit & chkhitthrow.ls < prev    next >
Encoding:
Text File  |  2004-12-06  |  7.3 KB  |  211 lines

  1. on bchkhit
  2.   global advance, ppl
  3.   if advance = 1 then
  4.     chkhit(getAt(ppl, 2), 56, 65, 2, 1, 73)
  5.   else
  6.     if (advance = 2) or (advance = 3) then
  7.       chkhit(getAt(ppl, 3), 87, 94, 3, 2, 137)
  8.       chkhit(getAt(ppl, 4), 116, 122, 4, 3, 138)
  9.     else
  10.       if advance = 4 then
  11.         chkhit(getAt(ppl, 2), 56, 65, 2, 1, 73)
  12.       else
  13.         if (advance = 6) or (advance = 7) then
  14.           chkhit(getAt(ppl, 2), 175, 180, 2, 1, 207)
  15.           chkhit(getAt(ppl, 3), 175, 180, 3, 2, 207)
  16.         else
  17.           if (advance > 8) and (advance < 12) then
  18.             chkhit(getAt(ppl, 2), 56, 65, 2, 1, 73)
  19.             chkhit(getAt(ppl, 3), 175, 180, 3, 2, 207)
  20.             chkhit(getAt(ppl, 4), 175, 180, 4, 3, 207)
  21.             if the memberNum of sprite getAt(ppl, 1) > 89 then
  22.               chkhitthrow(15)
  23.               chkhitthrow(16)
  24.             end if
  25.           else
  26.             if (advance = 12) and (the memberNum of sprite getAt(ppl, 1) > 89) then
  27.               chkhitthrow(15)
  28.               chkhitthrow(16)
  29.             else
  30.               if (advance = 13) or (advance = 14) then
  31.                 chkhitlamp(4)
  32.                 chkhit(getAt(ppl, 2), 87, 94, 2, 1, 137)
  33.                 chkhit(getAt(ppl, 3), 116, 122, 3, 2, 138)
  34.               else
  35.                 if advance = 15 then
  36.                   chkhitlamp(4)
  37.                   chkhit(getAt(ppl, 4), 271, 280, 4, 3, 294)
  38.                 else
  39.                   if (advance = 16) or (advance = 17) then
  40.                     chkhitlamp(4)
  41.                     chkhit(getAt(ppl, 4), 271, 280, 4, 3, 294)
  42.                     chkhit(getAt(ppl, 3), 116, 122, 3, 2, 138)
  43.                   end if
  44.                 end if
  45.               end if
  46.             end if
  47.           end if
  48.         end if
  49.       end if
  50.     end if
  51.   end if
  52.   if the memberNum of sprite getAt(ppl, 1) > 89 then
  53.     set the member of sprite getAt(ppl, 1) to member(1, 2)
  54.   end if
  55. end
  56.  
  57. on chkhit foecnl, boxplc, hit1, mnvplc, foeplc, ded
  58.   global ppl, mnv, foes, pwr, advance, fxpath
  59.   if (the memberNum of sprite getAt(ppl, 1) > 89) and (the memberNum of sprite foecnl <> ded) and (the castLibNum of sprite getAt(ppl, 1) = 2) then
  60.     o = the memberNum of sprite getAt(ppl, 1)
  61.     o = member(o, 2).name
  62.     set the loc of sprite 32 to the loc of sprite getAt(ppl, 1)
  63.     set the locV of sprite 32 to the locV of sprite 32 - 125
  64.     updateStage()
  65.     i = 1
  66.     repeat while i < 6
  67.       if sprite(getAt(ppl, 1)).flipH = 0 then
  68.         set the loc of sprite 32 to point(the locH of sprite 32 + value(item 1 of o), the locV of sprite 32 + value(item 2 of o))
  69.       else
  70.         set the loc of sprite 32 to point(the locH of sprite 32 - value(item 1 of o), the locV of sprite 32 + value(item 2 of o))
  71.       end if
  72.       updateStage()
  73.       if sprite 32 within foecnl then
  74.         i = 10
  75.         set the member of sprite foecnl to member(hit1 + 1, 1)
  76.         setAt(mnv, mnvplc, 15)
  77.         setAt(foes, foeplc, hit1 + 1)
  78.         setAt(pwr, mnvplc, getAt(pwr, mnvplc) - 20)
  79.         sound playFile 1, fxpath & "psy2.aif"
  80.         if getAt(pwr, mnvplc) < 0 then
  81.           set the member of sprite getAt(ppl, mnvplc) to member(ded, 1)
  82.           setAt(foes, foeplc, ded)
  83.           advance = advance + 1
  84.           advances()
  85.         end if
  86.       end if
  87.       i = i + 1
  88.     end repeat
  89.   else
  90.     if sprite getAt(ppl, 1) intersects foecnl and (getAt(foes, foeplc) < boxplc) and (abs(the locV of sprite getAt(ppl, 1) - the locV of sprite foecnl) < 24) and (sprite(getAt(ppl, 1)).flipH = sprite(foecnl).flipH) then
  91.       set the member of sprite foecnl to member(hit1, 1)
  92.       setAt(mnv, mnvplc, random(14) + 4)
  93.       setAt(foes, foeplc, hit1)
  94.       setAt(pwr, mnvplc, getAt(pwr, mnvplc) - 5)
  95.       sound playFile 1, fxpath & "psy1.aif"
  96.     else
  97.       if sprite getAt(ppl, 1) intersects foecnl and (getAt(foes, foeplc) = hit1) and (sprite(getAt(ppl, 1)).flipH = sprite(foecnl).flipH) then
  98.         set the member of sprite foecnl to member(hit1 + 1, 1)
  99.         setAt(mnv, mnvplc, 15)
  100.         setAt(foes, foeplc, hit1 + 1)
  101.         setAt(pwr, mnvplc, getAt(pwr, mnvplc) - 10)
  102.         if random(2) = 1 then
  103.           sound playFile 2, fxpath & 263 + random(5)
  104.         else
  105.           sound playFile 1, fxpath & "psy2.aif"
  106.         end if
  107.         if getAt(pwr, mnvplc) < 0 then
  108.           set the member of sprite getAt(ppl, mnvplc) to member(ded, 1)
  109.           setAt(foes, foeplc, ded)
  110.           advance = advance + 1
  111.           advances()
  112.         end if
  113.       end if
  114.     end if
  115.   end if
  116. end
  117.  
  118. on advances
  119.   global advance, foes, ppl, pwr, fxpath
  120.   if advance = 2 then
  121.     set the member of sprite getAt(ppl, 3) to member(getAt(foes, 2), 1)
  122.     set the member of sprite getAt(ppl, 4) to member(getAt(foes, 3), 1)
  123.   else
  124.     if advance = 4 then
  125.       setAt(foes, 1, 43)
  126.       setAt(pwr, 2, 50)
  127.     else
  128.       if advance = 5 then
  129.         sprite(30).visible = 1
  130.         sound playFile 1, fxpath & "go1.aif"
  131.       else
  132.         if advance = 8 then
  133.           sprite(41).visible = 1
  134.           sound playFile 1, fxpath & "go1.aif"
  135.         else
  136.           if advance = 12 then
  137.             sprite(41).visible = 1
  138.             sound playFile 1, fxpath & "go1.aif"
  139.           else
  140.             if advance = 16 then
  141.               setAt(foes, 2, 103)
  142.               setAt(pwr, 3, 50)
  143.               setAt(foes, 3, 262)
  144.               setAt(pwr, 4, 50)
  145.             else
  146.               if advance = 18 then
  147.                 sprite(41).visible = 1
  148.                 sound playFile 1, fxpath & "go1.aif"
  149.               end if
  150.             end if
  151.           end if
  152.         end if
  153.       end if
  154.     end if
  155.   end if
  156. end
  157.  
  158. on chkhitthrow foecnl
  159.   global ppl, fxpath
  160.   if the memberNum of sprite foecnl <> 258 then
  161.     o = the memberNum of sprite getAt(ppl, 1)
  162.     o = member(o, 2).name
  163.     set the loc of sprite 32 to the loc of sprite getAt(ppl, 1)
  164.     updateStage()
  165.     i = 1
  166.     repeat while i < 6
  167.       if sprite(getAt(ppl, 1)).flipH = 0 then
  168.         set the loc of sprite 32 to point(the locH of sprite 32 + value(item 1 of o), the locV of sprite 32 + value(item 2 of o))
  169.       else
  170.         set the loc of sprite 32 to point(the locH of sprite 32 - value(item 1 of o), the locV of sprite 32 + value(item 2 of o))
  171.       end if
  172.       updateStage()
  173.       if sprite 32 intersects foecnl then
  174.         i = 10
  175.         set the member of sprite foecnl to member(258)
  176.         set the locV of sprite foecnl to the locV of sprite foecnl - 40
  177.         sound playFile 1, fxpath & "psy2.aif"
  178.       end if
  179.       i = i + 1
  180.     end repeat
  181.   end if
  182. end
  183.  
  184. on chkhitlamp lmpsprt
  185.   global ppl, shandlir, fxpath
  186.   if (the memberNum of sprite lmpsprt = 302) and (shandlir = 0) then
  187.     o = the memberNum of sprite getAt(ppl, 1)
  188.     o = member(o, 2).name
  189.     set the loc of sprite 32 to the loc of sprite getAt(ppl, 1)
  190.     updateStage()
  191.     i = 1
  192.     repeat while i < 6
  193.       if sprite(getAt(ppl, 1)).flipH = 0 then
  194.         set the loc of sprite 32 to point(the locH of sprite 32 + value(item 1 of o), the locV of sprite 32 + value(item 2 of o))
  195.       else
  196.         set the loc of sprite 32 to point(the locH of sprite 32 - value(item 1 of o), the locV of sprite 32 + value(item 2 of o))
  197.       end if
  198.       updateStage()
  199.       if sprite 32 intersects lmpsprt then
  200.         i = 10
  201.         puppetSprite(lmpsprt, 1)
  202.         shandlir = 10
  203.         set the locV of sprite lmpsprt to the locV of sprite lmpsprt + 40
  204.         set the locH of sprite lmpsprt to the locH of sprite lmpsprt - 10
  205.         sound playFile 1, fxpath & "shandlir.aif"
  206.       end if
  207.       i = i + 1
  208.     end repeat
  209.   end if
  210. end
  211.